$(document).ready(function(){
	
	if ($('.pbox').length > 0) {
		$('.pbox').pbox();
	}
	
	$('.infoBar').transify({opacityOrig:.7,opacityNew:.7,fadeSpeed:200});
	$('.catTitle').transify({opacityOrig:.5,opacityNew:.5,fadeSpeed:200});
});

/**
 * jQuery.pbox - Show the product info. on photo
 *
 * @author	NEO
 * @version 1.0
 *
 **/

(function($){

	$.fn.pbox = function(options)
	{
		var settings = $.extend({

		}, options);		

		return this.each(
			function()
			{				
				var $$ = $(this), 
					info_bar = $$.find('div.infoBar'), 
					container_height = $$.height(), 
					content_height = $$.find('.infoBar').height(),
					caption_height = $$.find('label:gt(0)').height(),
					current_top = $$.find('.infoBar').position().top;
				
				// calculate the position				
				var position_on_hover = container_height - content_height - 6;

				$$.hover(
					function () {							
						info_bar.animate({ top: position_on_hover }, 300);
					},
					function () {		
						info_bar.animate({ top: current_top }, 200);
					}
				);				
			}
		);
	};

})(jQuery);